<?php

class ListSeleccioneWf extends TPage {

  public function onLoad($param) {
    parent::onLoad($param);

    if (!$this->IsPostBack) {
      $session = new THttpSession;
      $session->open();
      $arr = $this->obtenerDatos();
      $this->iniciarControles($arr);
    }
  }

  private function obtenerDatos() {
    $idEmpresa = Utilidades::obtenerIdEmpresaActiva();
    $arrWorkflow = WfWorkflow::obtenerDetallePorIdEmpresa($idEmpresa);
    return $arrWorkflow;
  }

  private function iniciarControles($arrWorkflow) {
    foreach ($arrWorkflow as $value) {
      $queryString = Utilidades::obtenerQueryStringFlujo(Utilidades::QUERYSTRING_FLUJO_NORMAL, "", "0", $value["Id"], $value["IdEmpresa"], "0", $value["IdCache"], "0", "0", "0", "");
      $this->lblWf->Text .= "<a target='_parent' href='index.php?page=Workflow." . $value["ClasePagina"] . "&a=" . $queryString . "' title='" . $value["Descripcion"] . "'>" . $value["Nombre"] . "</a><br>";
    }
  }

}

?>
